<extend name="public@:user_basics" />
<block name="body">

	<div class="row-content am-cf" v-block id="app">
		<div class="row am-cf">
			<div class="am-u-sm-12 am-u-md-6">
				<div class="widget am-cf" style="margin-bottom: 0;">
					<form action="{:url('user/profile/editPost')}" method="post" id="user-update"  class="am-form tpl-form-line-form">
						<div class="am-form-group">
							<label for="user-name" class="am-u-sm-3 am-form-label">商家名称 </label>
							<div class="am-u-sm-9">
								<input type="text" name="user_nickname" class="tpl-form-input disabled" value="{$user_nickname}"  id="user-name" >
							</div>
						</div>
						<div class="am-form-group">
							<label for="user-name" class="am-u-sm-3 am-form-label">商家邮箱 </label>
							<div class="am-u-sm-9">
								<input type="text" class="tpl-form-input disabled" disabled="disabled" value="{$user_email}" disabled="disabled" id="user-name" >
							</div>
						</div>
						<div class="am-form-group">
							<label for="user-name" class="am-u-sm-3 am-form-label">商家手机 </label>
							<div class="am-u-sm-9">
								<input type="text" class="tpl-form-input disabled" value="{$user_phone}" name="user_phone" id="user-name">
							</div>
						</div>
						<div class="am-form-group">
							<label for="user-name" class="am-u-sm-3 am-form-label">商家QQ </label>
							<div class="am-u-sm-9">
								<input type="text" class="tpl-form-input" name="qq" value="{$qq}"  id="user-name" >
							</div>
						</div>
						<div class="am-form-group">
							<label for="user-name" class="am-u-sm-3 am-form-label">支付宝姓名 </label>
							<div class="am-u-sm-9">
								<input type="text" class="tpl-form-input" name="alipay_name" value="{$alipay_name}"  id="user-name" >
							</div>
						</div>
						<div class="am-form-group">
							<label for="user-name" class="am-u-sm-3 am-form-label">支付宝账号（收钱用） </label>
							<div class="am-u-sm-9">
								<input type="text" class="tpl-form-input" name="alipay_user" value="{$alipay_user}"  id="user-name" >
							</div>
						</div>
						<div class="am-form-group">
							<label for="user-name" class="am-u-sm-3 am-form-label">商家店铺地址 </label>
							<div class="am-u-sm-9">
								{$shop_url}
							</div>
						</div>
						<div class="am-form-group">
							<label for="user-name" class="am-u-sm-3 am-form-label">店铺三级域名 </label>
							<div class="am-u-sm-9">
								<input type="text" class="tpl-form-input" name="domain" value="{$domain}" v-model="sanJiYuMing"  id="user-name" >
								<p>{{sanJiYuMing}}.{{yuMing}}</p>
							</div>
						</div>

						<button class="am-btn am-btn-primary tpl-btn-bg-color-success bcsz" type="submit"><span class="am-icon-check-square-o"></span>保存设置</button>
					</form>
				</div>

			</div>
			<div class="am-u-sm-12 am-u-md-6">
				<div class="widget am-cf" style="margin-bottom: 0;">
					<div class="widget-head am-cf">
						<div class="widget-title am-fl"><span class="am-icon-tasks"></span>店铺链接</div>
					</div>
					<div class="dplj">
						<div class="dplj1">
							<h4>长链接(备用)：</h4>
							<p>{$shop_url}</p>
						</div>
						<small>二维码链接不稳定或无法打开,请用此链接</small>
					</div>
					<div class="dplj">
						<div class="dplj1">
							<h4>二维码链接：</h4>
							<div id="ma" style="width: 100%">
							</div>

						</div>
						<small>二维码可以很方便的放在网店或者分享到手机客户端，鼠标右击即刻保存图片</small>
					</div>
					<div class="widget-body-md widget-body tpl-amendment-echarts am-fr" id="tpl-echarts" style="display: none; -webkit-tap-highlight-color: transparent; user-select: none; position: relative; background: transparent;" _echarts_instance_="ec_1546739998611"><div style="position: relative; overflow: hidden; width: 70px; height: 474px;"><canvas width="70" height="474" data-zr-dom-id="zr_0" style="position: absolute; left: 0px; top: 0px; width: 70px; height: 474px; user-select: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></canvas></div><div></div></div>
				</div>
			</div>
		</div>
	</div>
	<div class="widget-body-md widget-body tpl-amendment-echarts am-fr" id="tpl-echarts" style="display: none;">
	</div>
	<script src="__PUBLIC__/js/jquery.qrcode.min.js"></script>
	<script>
		$(function () {
			var app = new Vue({
				el:'#app',
				data:function () {
					return {
						yuMing:'{$location}'
						,sanJiYuMing:'{$domain}'
					}
				}
			})
			$('#ma').qrcode({width:300,height:300,text:"{$shop_url}"});
			
			//异步提交
			$('#user-update').submit(function () {
					$.post($(this).attr('action'),$(this).serialize(),function (da) {
						if(da.code == 1){
							swal({
								title:da.msg,
								text: '商家编辑提示'
								,type:'success'
							}).then(function () {
								location.reload();
							});
							// sweetAlert(da.msg,'','success')
						}else{
							sweetAlert(da.msg,'商家编辑提示','error')
						}
					});
				return false;
			})
		})
	</script>
</block>